<template>
  <view class="custom-uni-view">
    <view class="common-card" v-for="(item, index) in orderData" :key="index">
      <view class="top">
        <view class="img">
          <image :src="item.imageUrl"></image>
        </view>
        <view class="tit text2Ellipsis">
          {{item.title}}
        </view>
      </view>
      <view class="cont">
        <view class="cont-tit">审核失败</view>
        <view class="cont-box">
          <view class="text1">失败原因</view>
          <view class="text2">{{item.auditRemark?item.auditRemark:'无'}}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { findMyPage } from '@/service/hot/hot.service.js'
var _self;
export default {
  data() {
    return {
      pages: {
        current: 1,
        size: 10,
        total: 0
      },
      orderData: [],
    };
  },
  mounted() {
    _self = this;
    this.getDatas();
  },
  onReachBottom: () => {
    if (this.pages.current == 1) {
      return false;
    } else if (this.pages.total > this.orderData.length) {
      this.getDatas();
    } else if (this.pages.current != 1) {
      uni.showToast({
        title: '已经到底了',
        icon: 'none'
      })
    }
  },
  methods: {
    getDatas () {
      uni.showLoading();
      let params = {
        size: this.pages.size,
        current: this.pages.current,
        status: 4 // 失败
      }
      findMyPage(params, (res) => {
        if (res.status == 0) {
          if (this.pages.current == 1) {
            this.orderData = res.data.records;
          } else {
            this.orderData.push(...res.data.records);
          }
          this.pages.total = res.data.total;
          if (this.pages.total > this.orderData.length) {
            this.pages.current++
          }
        } else {
          uni.showToast({
            title: res.msg,
            icon: 'none'
          });
        }
        uni.hideLoading();
      });
      
    }
  }
}
</script>

<style lang="scss">
image {
  width: 100%;
  height: 100%;
}
.loading {
  text-align: center;
  font-size: 26rpx;
  color: #999999;
}
.custom-uni-view {
  padding: 38rpx 32rpx;
  color: #333333;
  .common-card {
    padding: 25rpx 30rpx;
    margin-bottom: 20rpx;
    .top {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      .img {
        flex-shrink: 0;
        width: 100rpx;
        height: 100rpx;
        margin-right: 24rpx;
      }
      .tit {
        font-size: 28rpx;
        font-weight: bold;
      }
    }
    .cont {
      padding-top: 24rpx;
      &-tit {
        font-size: 28rpx;
        color: #FF7473;
        margin-bottom: 15rpx;
        text-align: center;
      }
      &-box {
        padding: 27rpx 29rpx;
        background-color: #FAFAFA;
        .text1 {
          font-size: 26rpx;
          margin-bottom: 21rpx;
        }
        .text2 {
          font-size: 22rpx;
          color: #999999;
          margin-left: 24rpx;
        }
      }
    }
  }
}
</style>
